<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Request;
use think\Route;
header("content-type:text/html;charset=utf-8");
class Kkk extends Controller
//命名空间
{
    public function index()
    {
        $request = request();
        $aa = $request->route('cate_id');
//        $aa = $request->param('cate_id');
//        $aa = input('get.cate_id');;
//        var_dump($aa);exit();


//        $request = Request::instance();
        $sss=Db::table('news')->field('title,describ,content')->limit(1,10)->select();
        return $this->fetch('index');
    }
    public function news(){
        $this->oooo(1,'asdsad');
        return 'asnhdjsanhdjuasndjsa';
    }
    public function oooo($a = 2,$b = 'qqqqq'){
        echo $a.$b;
    }
    public function page(){
        phpinfo();
//        url();
//        $this->success('成功成功成功', 'index/index', '',  10);
//        $this->error('新增失败', 'index/index');
////        传参  重定向
//        $this->redirect('index/index', ['kkkk' => 2]);
//          url('index/index');
//        Url::build();
//        $request = Request::instance();
//        $request = request();
//        $_POST['']
//        $kkkk = $request ->post('id');
//        $kkkk = $request ->get('id');
//        $kkkk = $request ->route('id');
//        $kkkk = $request ->param('id');
//        var_dump($kkkk); exit;

//        $id = isset($get['id'])?$get['id']:1;
//        $cont = 6;
////        select * from 表名 ；
//        $result = Db::table('news')->field('count(*) as total')->find();
//        $num = $result['total'];
//        $total_page = ceil($num/$cont);
//
//        $start= ($id-1)*$cont;
//        $row = Db::table('news')->limit($start,$cont)->select();
//        $last= ($id==1)?1:$id-1;
//        $next= ($id==$total_page)?$total_page:$id+1;
//
//        $str='';
//        $str.="<a href='http://localhost/kkkkk/public/index.php/index/kkk/page/id/1'>首页</a>";
//        $str.="<a href='http://localhost/kkkkk/public/index.php/index/kkk/page/id=$last'>上一页</a>";
//
//        $str.="<a href='http://localhost/kkkkk/public/index.php/index/kkk/page/id/$next'>下一页</a>";
//        $str.="<a href='http://localhost/kkkkk/public/index.php/index/kkk/page/id=$total_page'>尾页</a>";
//        $this->assign('str',$str);


//        url('index/index/index');



        return $this->fetch('Kkk/hhh/index');
    }


}
